<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{fragments/main_layout}">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div layout:fragment="content" class="container">
    <form action="/users" class="form-inline">
        <div class="form-group mb-2">
            <input type="text" class="form-control" name="name" placeholder="查找用户"/>
            <input type="submit" value="搜索" class="btn btn-primary">
        </div>
    </form>
    <div class="card">
        <div class="card card-body">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>名字</th>
                    <th>电邮</th>
                    <th>添加</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="user:${users}">
                    <td th:text="${user.name}"></td>
                    <td th:text="${user.email}"></td>
                    <td><a th:href="@{/addTask(email=${user.email})}" class="btn btn-dark">添加任务</a></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

</div>
</body>
</html>